<?php
/**
 * 用户银行卡
 */
class User_bank_model extends CI_Model
{
    private $_table  = 'user_bank';
    private $_table1 = 'user';

    /**
     * $uids array 
     * 查找扫码景区账号  银行卡信息
     */
    public function findScanUserBank($uids, $limit = '')
    {
        $this->db->select('bank_id, bank_card, cardholder, pin, bank_name, user_bank.mobile_phone, user_name, user.uid');
        $this->db->from($this->_table);
        $this->db->join($this->_table1, 'user.uid = user_bank.uid', 'INNER');
        $this->db->where_in('user.uid', $uids);
        $this->db->where('is_default', 1); //扫码景区
        if ($limit) {
            $this->db->limit($limit);
        }
        return $this->db->get();
    }
}